{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}

module Language.ASTExpr.ASTExpr where

import Generics.MultiRec
import Generics.MultiRec.TH.Alt

import Language.ASTExpr.Syntax

data AST :: * -> * where
  TheSourceSpan  :: AST SourceSpan
  TheExpr        :: AST Expr
  TheDecl        :: AST Decl

$(deriveEverything
  (DerivOptions
    [ ( [t| SourceSpan |] ,"TheSourceSpan")
    , ( [t| Expr |]       ,"TheExpr")
    , ( [t| Decl |]       ,"TheDecl")
   ]
   "AST"
   (\t c -> "CONSTRUCTOR_" ++ t ++ "_" ++ c)
   "PFAST"
   False
   Balanced
  )
 )

type instance PF AST = PFAST
